package com.itany.test;
 
import junit.framework.TestCase;
 
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
 
import com.itany.www.Student;
 
public class StudentTest01 extends TestCase
{
    private Student testStudent;
    @Before//此方法在执行每一个测试方法之前（测试用例）之前调用
    protected void setUp()
        throws Exception
    {
        super.setUp();
        testStudent=new Student("djm", "boy", 178, 24, "华东政法");
        System.out.println("already setUp()");
    }
    
    @After//此方法在执行每一个测试方法之后调用
    protected void tearDown()
        throws Exception
    {
        super.tearDown();
        System.out.println("already tearDown()");
    }
    
    @Test//表示测试用例 也就是方法的方法
    public void testGetSex()
    {
        assertEquals("boy", testStudent.getSex());  
        System.out.println("testGetSex()");  
    }
    
    @Test
    public void testGetAge()
    {
        assertEquals(24,testStudent.getAge());
        System.out.println("testGetAge()");  
    }
    
}
